<template>
  <div class="video clearfix">
    <top></top>
    <div class="center">
      <div class="v_dcontent main clearfix">
        <div class="con1-pos">
          <span class="icon"></span>
          <a href>王者荣耀首页</a>
          <span>></span>
          <label>视频详情</label>
        </div>
        <div class="left clearfix fl">
          <div class="title clearfix">
            <span class="text fl" v-for="item in cenConlist" :key="item.id">
              {{item.id==aa?item.video_title:""}}
              <!-- {{aa}} -->
            </span>
            <span class="num fr">
              <img src="//game.gtimg.cn/images/yxzj/web201605/page/player_smicon.png" alt />
              <span>播放量11888</span>
            </span>
          </div>
          <div class="video-box"></div>
          <div class="share_block fr">
            <span>分享到：</span>
            <a href class="a1"></a>
            <a href class="a2"></a>
            <a href class="a3"></a>
            <a href class="a4"></a>
            <a href class="a5"></a>
            <a href class="a6"></a>
            <a href class="a7"></a>
            <a href class="a8"></a>
            <a href class="a9"></a>
          </div>
        </div>
        <div class="right fr">
          <div class="title">
            <img
              src="//game.gtimg.cn/images/yxzj/web201605/page/icon_vtop.png"
              alt
              width="18"
              height="24"
            />
            热门视频
          </div>
          <div class="tab">
            <template>
              <el-tabs v-model="activeName" @tab-click="handleClick" stretch>
                <el-tab-pane label="今日" name="first">
                  <ul>
                    <li v-for="item in tab.day" :key="item.number" :class="item.class">
                      <div class="list fl">{{item.number}}</div>
                      <div class="hero_top_sort fl">
                        <span class="vd_tabtitle">{{item.title}}</span>
                        <br />
                        <span class="vd_desc">
                          <span class="time">{{item.time}}</span>
                          <span class="fr vd_desc_less">
                            <img
                              src="//game.gtimg.cn/images/yxzj/web201605/page/player_smicon_ract.png"
                              alt
                            />
                            {{item.num}}
                          </span>
                        </span>
                      </div>
                    </li>
                  </ul>
                </el-tab-pane>
                <el-tab-pane label="本周" name="second">
                  <ul>
                    <li v-for="item in tab.week" :key="item.number" :class="item.class">
                      <div class="list fl">{{item.number}}</div>
                      <div class="hero_top_sort fl">
                        <span class="vd_tabtitle">{{item.title}}</span>
                        <br />
                        <span class="vd_desc">
                          <span class="time">{{item.time}}</span>
                          <span class="fr vd_desc_less">
                            <img
                              src="//game.gtimg.cn/images/yxzj/web201605/page/player_smicon_ract.png"
                              alt
                            />
                            {{item.num}}
                          </span>
                        </span>
                      </div>
                    </li>
                  </ul>
                </el-tab-pane>
                <el-tab-pane label="本月" name="third">
                  <ul>
                    <li v-for="item in tab.month" :key="item.number" :class="item.class">
                      <div class="list fl">{{item.number}}</div>
                      <div class="hero_top_sort fl">
                        <span class="vd_tabtitle">{{item.title}}</span>
                        <br />
                        <span class="vd_desc">
                          <span class="time">{{item.time}}</span>
                          <span class="fr vd_desc_less">
                            <img
                              src="//game.gtimg.cn/images/yxzj/web201605/page/player_smicon_ract.png"
                              alt
                            />
                            {{item.num}}
                          </span>
                        </span>
                      </div>
                    </li>
                  </ul>
                </el-tab-pane>
              </el-tabs>
            </template>
          </div>
        </div>
      </div>
    </div>
    <div class="like main">
      <div class="title">
        <img src="//game.gtimg.cn/images/yxzj/web201605/page/icon_vedio.png" alt />
        猜你喜欢
      </div>
      <div class="video-box clearfix">
        <div class="box1 fl" v-for="likes in like" :key="likes.id">
          <img :src="likes.img" alt />
          <div>
            <span>{{likes.text}}</span>
          </div>
        </div>
      </div>
    </div>
    <footering></footering>
  </div>
</template>
<script>
import Footering from '../../../components/Footer'
import Top from '../../../components/Top'
export default {
  data: () => ({
    hero: '',
    activeName: 'first',
    tab: '',
    like: '',
    cenConlist: '',
    aa: ''
  }),
  created () {
    this.gethero()
    this.gettab()
    this.getlike()
    this.centerCon()
  },
  methods: {
    // 请求内容中心数据
    async centerCon () {
      const {
        data: { contentcenter, status }
      } = await this.$axios.get('/centercon')
      if (status !== 1) alert('数据请求不到')
      this.cenConlist = contentcenter[0].content[0].video_content
      console.log(contentcenter[0].content[0].video_content[0].id)
      console.log(contentcenter[0].content[0].video_content)
      // this.cenConlist[0].content.forEach(el => {
      //   this.idFisrtCon.push(el)
      //   console.log(contentcenter)
      // })
      // // 选择英雄的英雄列表
      // this.conHerolist = this.cenConlist[2].chooseherolist
      // this.Amouseenter(101)
      // this.chooseClass(340000)
      this.aa = this.$route.params.id
      // console.log(this.aa.slice(0, 1))
    },
    handleClick () {},
    async gethero () {
      const { data, status } = await this.$axios('/gethero')
      if (status !== 200) alert('数据请求不到')
      this.hero = data
    },
    async gettab () {
      const { data, status } = await this.$axios('/gettab')
      if (status !== 200) alert('数据请求不到')
      this.tab = data
    },
    async getlike () {
      const { data, status } = await this.$axios('/getlike')
      if (status !== 200) alert('数据请求不到')
      this.like = data
    }
  },
  components: {
    Footering,
    Top
  }
}
</script>
<style lang="less" scoped>
.video {
  background: url(//game.gtimg.cn/images/yxzj/web201605/page/ny_con_bg.jpg) no-repeat center top;
  background-size: 100% 100%;
  li {
    list-style: none;
  }
  .clearfix:before,
  .clearfix:after {
    content: '';
    display: block;
    clear: both;
  }
  .main {
    width: 1200px;
    margin: auto;
  }
  .fl {
    float: left;
  }
  .fr {
    float: right;
  }

  .center {
    padding-top: 30px;
    padding-bottom: 40px;
    // width: 100%;
    min-width: 1280px;
    // height: 890px;
    background: url(//game.gtimg.cn/images/yxzj/web201605/page/ny_con_bg.jpg) no-repeat center top;
    background-size: 100% 100%;
    .v_dcontent {
      // height: 1500px;
      .con1-pos {
        margin-bottom: 30px;
        color: #363636;
        .icon {
          background: url(//game.gtimg.cn/images/yxzj/web201605/page/sprite.png) no-repeat;
          text-indent: -9999px;
          display: inline-block;
          width: 20px;
          height: 20px;
        }
        a {
          color: #363636;
        }
        span {
          margin: 0 10px;
        }
      }
      .left {
        width: 750px;
        .title {
          line-height: 56px;
          .text {
            // width: 200px;
            font-size: 20px;
            font-weight: bold;
            white-space: nowrap;
            overflow: hidden;
          }
          .num span {
            font-size: 14px;
            color: #616161;
          }
        }
        .video-box {
          height: 404px;
          background: #000;
          background: url('../../../assets/ea64406f6a0a73b46e6a31b7a99796f.png');
        }
        .share_block {
          line-height: 50px;
          width: fit-content;
          height: 50px;
          // background: pink;
          a {
            margin-right: 3px;
            display: inline-block;
            width: 16px;
            height: 16px;
            background-image: url(//ossweb-img.qq.com/images/icon/share/icon-sns-16.png);
          }
          .a2 {
            background-position-x: -20px;
          }
          .a3 {
            background-position-x: -40px;
          }
          .a4 {
            background-position-x: -60px;
          }
          .a5 {
            background-position-x: -80px;
          }
          .a6 {
            background-position-x: -100px;
          }
          .a7 {
            background-position-x: -120px;
          }
          .a8 {
            background-position-x: 140px;
          }
          .a9 {
            background-position-x: -160px;
          }
        }
      }
      .right {
        width: 420px;
        // height: 800px;
        // background: pink;
        .title {
          font-size: 20px;
          font-weight: bold;
        }
        // .el-tabs__item {
        //   font-size: 20px;
        //   font-weight: bold;
        // }
        .tab {
          ul {
            margin: 0;
            padding: 0;
            li {
              margin-bottom: 5px;
            }
            .vd_tabtitle {
              width: 200px;
              font-size: 14px;
              overflow: hidden;
              white-space: nowrap;
              // background: red;
            }
            .vd_desc {
              font-size: 12px;
              color: #bbbbbb;
              .time {
                padding-left: 7px;
              }
              .vd_desc_less {
                display: inline-block;
                width: 50px;
                text-align: left;
                padding-top: 9px;
              }
            }
            .big {
              .list {
                color: #1176da;
                height: 44px;
                font-size: 38px;
              }
              .hero_top_sort {
                margin: 0 3px;
                width: 370px;
                padding-top: 5px;
                // background: red;
              }
            }
            .small {
              .list {
                color: #fff;
                text-align: center;
                line-height: 24px;
                width: 24px;
                height: 24px;
                border-radius: 50%;
                background: #aeaeae;
              }
              .hero_top_sort {
                margin: 0 3px;
                width: 368px;
                height: 22px;
                padding-top: 3px;
                .vd_tabtitle {
                  display: inline-block;
                  width: 266px;
                  // background: red;
                  overflow: hidden;
                  white-space: nowrap;
                  text-overflow: ellipsis;
                }
              }
            }
          }
        }
      }
    }
  }
  .like {
    padding-top: 40px;
    .title {
      // padding-top: 5px;
      font-size: 20px;
      font-weight: bold;
      line-height: 22px;
      img {
        height: 20px;
        vertical-align: middle;
      }
    }
    .video-box {
      margin-left: 10px;
      .box1 {
        width: 182px;
        height: 165px;
        margin: 40px 0;
        margin-left: 16px;
        border-radius: 3px;
        overflow: hidden;
        background: #fff;
        img {
          width: 100%;
          height: 110px;
          margin-bottom: 5px;
        }
        div {
          padding-left: 5px;
          span {
            margin-top: 5px;
            font-size: 14px;
            line-height: 16px;
            color: #616161;
            font-weight: bold;
          }
        }
      }
    }
  }
}
</style>
